/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package threads;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author anh_yeu_em_nhieu_lam
 */
public class ThreadBasicTwo implements Runnable{

    public void run() {
        for(int i= 0;i< 5;i++){
            try {
                System.out.print(Thread.currentThread().getName() + i + " \n");
                Thread.sleep(4000);
            } catch (InterruptedException ex) {
                Logger.getLogger(ThreadBasicTwo.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }
    /*
    public static void main(String arg[]){
        Thread t = new Thread(new ThreadBasicTwo());
        t.start();
        while(t.isAlive()){
            try {
                System.out.print("Wait.....\n");
                t.join(1000);
            } catch (InterruptedException ex) {
                Logger.getLogger(ThreadBasicTwo.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }**/
}
